home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BCI NET
/
BCI NET Dec 94.iso
/
archives
/
applications
/
wp
/
ged11.lha
/
Install
/
data
/
main
/
GoldED
/
API
/
include
/
golded.h
Wrap
C/C++ Source or Header
|
1994-08-12
|
13KB
|
244 lines
#ifndef GOLDED_API_H
#define GOLDED_API_H
/*
** $Filename: fd/GoldED.h
** $Release: 2.0
** $Revision: 37.5
**
** GoldED API definitions. This is a preliminary version; suggestions
** welcome.
**
** Définitions API de GoldED. Ceci est une version préliminaire; des
** suggestions sont bienvenues.
**
** (C) Copyright 1994 Dietmar Eilert
** All Rights Reserved · Tous Droits Réservés
*/
#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif
#ifndef EXEC_LISTS_H
#include <exec/lists.h>
#endif
#ifndef EXEC_LISTS_H
#include <exec/lists.h>
#endif
#ifndef INTUITION_INTUITION_H
#include <intuition/intuition.h>
#endif
#ifndef UTILITY_TAGITEM_H
#include <utility/tagitem>
#endif
#ifndef WORKBENCH_WORKBENCH_H
#include <workbench/workbench.h>
#endif
/* Basic peferences of current text · Préférences de base du texte actuel */
struct EditConfig {
struct Node Node; /* it's a linked list */
ULONG Magic; /* magic number */
struct LineNode *TextNodes; /* pointer to node of 1st line */
ULONG Lines; /* number of lines (abs) */
ULONG TopLine; /* 1st visible line (abs) */
UWORD TopColumn; /* 1st visible column (abs) */
UWORD Column; /* cursor x position (abs) */
ULONG Line; /* current line number */
UWORD LastChangeColumn; /* column of last change */
ULONG LastChangeLine; /* line of last change */
ULONG MaxLines; /* size of line ptr array */
char Path[141]; /* document's directory */
char Name[141]; /* document's name */
UBYTE Current[1000]; /* line buffer of current line */
UWORD CurrentLen; /* bytes in buffer */
char UndoBuf[1000]; /* undo buffer */
UWORD UndoLen; /* bytes in undo buffer */
ULONG UndoLine; /* line number of undo buffer */
BOOL LineModified; /* flag: line has changed */
BOOL DocModified; /* document-modified flag */
UWORD BlockStartX; /* block start (column) */
ULONG BlockStartY; /* block start (line) */
ULONG BlockEndX; /* block end (column) */
ULONG BlockEndY; /* block end (line) */
BOOL Marker; /* marker-used flag */
ULONG SearchLine; /* start line for find */
UWORD SearchColumn; /* start column for find */
long Protection; /* file's protection bits */
BOOL Folds; /* any folds ? */
BOOL LineNotFixed; /* line-may-be-changed flag */
BOOL ReadOnly; /* disable save ? */
char Comment[80]; /* file comment */
UWORD BackupCounter; /* AutoBackup counter [min] */
BOOL ValidName; /* file named ? */
/* private stuff follows · des choses privées suivent */
};
/* each line of a text has an associated line node, describing the line contents */
/* chaque ligne de texte possède un node de ligne associée, décrivant le contenu de la ligne */
struct LineNode {
UWORD Len; /* line's length */
char *Text; /* pointer to text data */
struct Fold *Fold; /* pointer to folded sub block */
};
/* each subblock of folded lines has a fold root · chaque sous-bloc de lignes pliées possède une racine de pli: */
struct Fold {
ULONG Lines; /* lines within folded block */
struct LineNode *TextNodes; /* pointer to node of 1st line */
};
/* Basic preferences of current window · Préférences de base de la fenêtre actuelle */
struct WindowSupportInfo {
struct Node Node; /* it's a linked list */
struct Window *Window; /* associated window */
struct EditConfig *EditConfig; /* text buffer (if any) */
UWORD Sleep; /* >0: show busy pointer */
struct Menu *Menu; /* menu bar (if any) */
struct Gadget *GadgetList; /* pointer to 1st gadget (if any) */
void *(*CleanUp)(void); /* window's cleanUp function */
void *(*Server)(void); /* window's handler */
void *(*CallBack)(APTR); /* all purpose callback function */
APTR Data; /* ptr to variables */
ULONG DataSize; /* size of variables */
ULONG Mode; /* all purpose buffer */
LONG Buffer; /* all purpose buffer */
UWORD Type; /* window/server type (1 = text window) */
UWORD ExitGadget; /* gadget to be used on ESC */
UWORD Left; /* window dimensions */
UWORD Top; /* window dimensions */
UWORD Width; /* window dimensions */
UWORD Height; /* window dimensions */
/* private stuff follows · des choses privées suivent */
};
/*
API messages are sent from GoldED to clients. API messages are linked
(api_Next; may be NULL). The client has to check the api_State field before
processing the message (must be API_STATE_NOTIFY). Check the api_Class field to
determine the basic message type (e.g. API_CLASS_SCREEN if the message is
related to screen handling). Check the api_Action field to determine the actual
command (e.g. API_ACTION_HIDE if GoldED wants you to close your windows). The
client will always recieve a pointer to basic configuration data of the current
text (api_Config) and of the current window (api_WinInfo). Some classes provide
additional data using the api_Data field. After having processed the message
you should update the api_Error field.
Les messages API sont envoyés de GoldED vers les clients. Les messages API sont
liés (api_Next; peut être NULL). Le client doit vérifier le champ api_State
avant de traiter le message (doit être API_STATE_NOTIFY). Vérifiez le champ
api_Class pour déterminer le type de message de base (ex: API_CLASS_SCREEN si
le message se rapporte à la gestion d'écran). Vérifiez le champ api_Action pour
déterminer la commande actuelle (ex: API_ACTION_HIDE si GoldED veut que vous
refermiez vos fenêtres). Le client recevra toujours un pointeur sur les données
de base de la configuration du texte actuel (api_Config) et de la fenêtre
actuelle (api_WinInfo). Certaines classes fournissent des données
supplémentaires en utilisant le champ api_Data. Après avoir traité le message,
vous devriez mettre à jour le champ api_Error.
*/
struct APIMessage {
struct Message api_Message; /* embedded message structure */
ULONG api_State; /* message state (valid/invalid) */
struct APIMessage *api_Next; /* next APIMessage */
struct EditConfig *api_Config; /* preferences of current text */
struct WindowSupportInfo *api_WinInfo; /* preferences of current window */
char *api_Screen; /* screen name */
ULONG api_Class; /* notify class (see below) */
ULONG api_Action; /* notify code (see below) */
ULONG api_Qualifier; /* intuition qualifier */
APTR api_Data; /* usage depends on api_Class */
ULONG api_Error; /* client's return code (see below) */
ULONG api_Refresh; /* display refresh request */
BOOL *api_User; /* pointer to array of user variables */
};
/* ARexx notify structure passed to clients (see API_ACTION_COMMAND below) */
/* Structure de notification ARexx passée aux clients (voir API_ACTION_COMMAND plus bas) */
struct APIRexxNotify {
char *arn_Command; /* command string passed to client (read-only), command part uppercase */
LONG arn_RC; /* client's primary return code */
char *arn_CommandResult; /* command result string (referenced, not copied by GoldED) */
char *arn_CommandError; /* command error string (referenced, not copied by GoldED) */
};
/* Notify classes. Clients will recieve only those classes they've asked for */
/* Classes de notification. Les clients recevront seulement les classes qu'ils demanderont */
#define API_CLASS_ROOT (1L<<0) /* must be supported by all clients */
#define API_CLASS_SCREEN (1L<<1) /* screen handling (open/close) */
#define API_CLASS_KEY (1L<<2) /* keyboard events */
#define API_CLASS_REXX (1L<<3) /* ARexx commands */
/* supported refresh types (api_Refresh) */
/* types de rafraîchissement gérés (api_Refresh) */
#define API_REFRESH_LINE (1L<<1) /* make GoldED redraw current line */
#define API_REFRESH_DISPLAY (1L<<2) /* make GoldED redraw the current text */
#define API_REFRESH_SYNC (1L<<3) /* adjust view according to cursor position (redraw if necessary) */
/* Supported api_Action values for API_CLASS_ROOT */
/* Valeurs api_Action supportées par API_CLASS_ROOT */
#define API_ACTION_NOP 0 /* no operation */
#define API_ACTION_DIE 1 /* close your windows (before replying message) & quit */
#define API_ACTION_CONFIG 2 /* open your preferences requester */
#define API_ACTION_INTRODUCE 3 /* return (static) tag list describing your client */
/* API_ACTION_INTRODUCE tags */
/* tags API_ACTION_INTRODUCE */
#define API_Client_Name (TAG_USER + 1) /* ti_Data pointing to client's name (UBYTE *) */
#define API_Client_Copyright (TAG_USER + 2) /* ti_Data pointing to copyright string (UBYTE *) */
#define API_Client_Purpose (TAG_USER + 3) /* ti_Data pointing to short description of client (UBYTE *) */
#define API_Client_Template (TAG_USER + 4) /* ti_Data pointing to a command template (UBYTE *); multiple use allowed */
/* Supported api_Action values for API_CLASS_KEY */
/* Valeurs api_Action supportées pour API_CLASS_KEY */
#define API_ACTION_VANILLAKEY 1 /* vanillakey event; key code passed in api_Data */
/* Supported api_Action values for API_CLASS_SCREEN */
/* Valeurs api_Action supportées pour API_CLASS_SCREEN */
#define API_ACTION_HIDE 1 /* close your windows (before replying message) */
#define API_ACTION_SHOW 2 /* open your windows (except config windows) */
/* Supported api_Action values for API_CLASS_REXX */
/* Valeurs api_Action supportées pour API_CLASS_REXX */
#define API_ACTION_COMMAND 1 /* internal/ARexx command passed to client (pointer to APIRexxNotify in api_Data) */
/* Supported api_Error values · Valeurs api_Error supportées */
#define API_ERROR_OK 0 /* notify successfully processed */
#define API_ERROR_FAIL 1 /* processing of notify failed */
#define API_ERROR_UNKNOWN 2 /* unknown api_Code/api_Class detected */
/* Supported api_State values · Valeurs api_State générées */
#define API_STATE_IGNORE 0 /* this messages should be ignored */
#define API_STATE_NOTIFY 1 /* this is a standard notify message */
#define API_STATE_CONSUMED 2 /* message consumed; won't be passed to other clients, no further processing by GoldED */
#endif